﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GabageFactory.Models.stack_daily_water_info>" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	水位及水质（每日）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%bool hasPriviledge = (bool)ViewData["hasPriviledge"];%>
    <div class="screen_area">
        <form method="Get" action="/Query/StackWater">
        <div>
        <%if ((bool)ViewData["showFactory"])
            {%>
        请选择公司：<%= Html.DropDownList("factoryId", ViewData["factories"] as List<SelectListItem>, "请选择公司", new { onchange = "showStacks();" })%>
        <span style="margin-left:20px"></span>
        <%
            }
            else
            {
        %>
        <%=Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%
            }
        %>
        <label>请选择堆场/尾矿库：</label><span id="stackList"><%= Html.DropDownList("stackId", ViewData["stacksAndTailingponds"] as List<SelectListItem>, "请选择")%></span>
        <span style="margin-left:20px"></span>
        <label>查询日期：</label><span><input type="text" name="date" id="date" size="12" value="<%=Model.date.Year %>-<%=Model.date.Month %>-<%=Model.date.Day %>" class="ipt_date" readonly="readonly" /></span>
        <span><input type="submit" value="查  询" /></span>
        </div>
        </form>
    </div>
    <div style="margin-top:10px;margin-bottom:10px"></div>
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
                <li><a href="javascript:return(false);" class="current"><span>水位及水质</span></a></li>
                <li><a href="/Query/BackWater?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Query/Settle?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移</span></a></li>
                <li><a href="/Query/Ardealite?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="/Query/Ditch?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>截洪沟</span></a></li>
                <li><a href="/Query/PiezometerWell?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>浸润线观测</span></a></li>
                <li><a href="/Query/PiezometerBase?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>渗压观测</span></a></li>
                <li><a href="/Query/Drain?stackId=<%=ViewData["stackId"]%>&date=<%=Model.date%>&factoryId=<%=ViewData["factoryId"] %>"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>
    
    <% 
        DateTime date = Model.date;
        DateTime preDate = date.AddDays(-1);
        DateTime nextDate = date.AddDays(1);
    %>

    <div class="dataarea">
        <a class="arrow_l" href="/Query/StackWater?stackId=<%=ViewData["stackId"]%>&date=<%=preDate%>&factoryId=<%=ViewData["factoryId"] %>" title="前一天">前一天</a>
        <strong><%= date.Year%>年<%=date.Month%>月<%=date.Day%>日</strong><%if (date.Date < DateTime.Now.Date){ %>
        <a class="arrow_r" href="/Query/StackWater?stackId=<%=ViewData["stackId"]%>&date=<%=nextDate%>&factoryId=<%=ViewData["factoryId"] %>" title="后一天">后一天</a><%} %>
    </div>
    
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="width:756px;">

        <tr>
            <td class="lab" style="width:126px;">测量人员：</td>
            <td>
                <%
                    User tester = (User) ViewData["tester"];
                    if (tester != null)
                    {
                %>
                <%=tester.RealName + " (" + tester.Name + ")"%>
                <%
                    }
                %>&nbsp;&nbsp;
            </td>
        </tr>
    </table>


    <table cellpadding="4" cellspacing="0" class="com_from_table3" style="width:756px;">
        <tr>
            <th colspan="3">库区环境</th>
        </tr>
        <tr>
            <td style="width:240px;">
                <label>堆场一区水位：</label>
                <em><%= Html.DisplayFor(model => model.partition1_water_level)%></em>
                <%if (Model.partition1_water_level.HasValue){ %>m<%} %>
            </td>
            <td style="width:240px;">
                <label>PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.partition1_water_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>堆场一区水量：</label>
                <em><%= Html.DisplayFor(model => model.partition1_water_capacity)%></em>
                <small><%if (Model.partition1_water_capacity.HasValue){ %> 万m<sup>3</sup><%} %></small>
            </td>
        </tr>
        <tr>
            <td style="width:240px;">
                <label>堆场二区水位：</label>
                <em><%= Html.DisplayFor(model => model.partition2_water_level)%></em>
                <%if (Model.partition2_water_level.HasValue){ %>m<%} %>
            </td>
            <td style="width:240px;">
                <label>PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.partition2_water_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>堆场二区水量：</label>
                <em><%= Html.DisplayFor(model => model.partition2_water_capacity)%></em>
                <small><%if (Model.partition2_water_capacity.HasValue){ %> 万m<sup>3</sup><%} %></small>
            </td>
        </tr>
        <%
            stack_pool_daily_water_info[] poolWaterInfos = (stack_pool_daily_water_info[])ViewData["poolWaterInfos"];
            for (int i = 0; i < poolWaterInfos.Length; i++)
            {
        %>
        <tr>
            <td style="width:240px;">
                <label><%if (poolWaterInfos.Length > 1) { %><%=(i + 1)%>号<%} %>调节水池水位：</label>
                <em><%=poolWaterInfos[i].pool_water_level%></em>
                <%if (poolWaterInfos[i].pool_water_level.HasValue){ %> m<%} %>
            </td>
            <td style="width:240px;">
                <label>PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%=poolWaterInfos[i].pool_water_ph%></em>
                <%} else { %>
                ☆
                <%} %>

            </td>
            <td>
                <label>调节水池水量：</label>
                <em><%=poolWaterInfos[i].pool_water_capacity%><%if (poolWaterInfos[i].pool_water_capacity.HasValue) { %></em>
                <small> 万m<sup>3</sup><%} %></small>
            </td>
        </tr>
        <%
            } 
        %>
    </table>


    <table cellpadding="4" cellspacing="0" class="com_from_table3" style="width:756px;">
        <tr>
            <th colspan="3">周边环境</th>
        </tr>
        <tr>
            <td style="width:240px;">
                <label>上游河流水位：</label>
                <em><%= Html.DisplayFor(model => model.upstream_water_level)%></em>
                <%if (Model.upstream_water_level.HasValue){ %> m <%} %>
            </td>
            <td style="width:240px;">
                <label>上游河流PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.upstream_water_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <label>上游河流总磷含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_up_phosphorus)%> </em>
                <small><%if (Model.total_up_phosphorus.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>上游河流总氟含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_up_fluorin)%></em>
                <small><%if (Model.total_up_fluorin.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>上游河流氨氮含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_up_ammonia)%></em>
                <small><%if (Model.total_up_ammonia.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
        </tr>
        <tr>
            <td>
                <label>下游河流水位：</label>
                <em><%= Html.DisplayFor(model => model.downstream_water_level)%></em>
                <%if (Model.downstream_water_level.HasValue) { %> m <%} %>
            </td>
            <td>
                <label>下游河流PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.downstream_water_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <label>下游河流总磷含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_down_phosphorus)%> </em>
                <small><%if (Model.total_down_phosphorus.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>下游河流总氟含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_down_fluorin)%></em>
                <small><%if (Model.total_down_fluorin.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>下游河流氨氮含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_down_ammonia)%></em>
                <small><%if (Model.total_down_ammonia.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
        </tr>
        <tr>
            <td>
                <label>调节水池下游PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.pool_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>总磷含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_pool_phosphorus)%> </em>
                <small><%if (Model.total_pool_phosphorus.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td>
                <label>总氟含量：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.total_pool_fluorin)%></em>
                <small><%if (Model.total_pool_fluorin.HasValue) { %>ppm<%} %></small>
                <%} else { %>
                ☆
                <%} %>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <label>库尾集水池水位：</label>
                <em><%= Html.DisplayFor(model => model.tail_pool_water_level)%></em>
                <%if (Model.tail_pool_water_level.HasValue){ %> m<%} %>
            </td>
        </tr>

    </table>
    
    
    <table cellpadding="4" cellspacing="0" class="com_from_table3" style="width:500px;">
        <tr>
            <th colspan="2">集水井</th>
        </tr>
        <tr>
            <td style="width:240px;">
                <label>集水井水位：</label>
                <em><%= Html.DisplayFor(model => model.catchpit_water_level)%></em>
                <%if (Model.catchpit_water_level.HasValue) { %> m<%} %>
            </td>
            <td style="width:240px;">
                <label>集水井PH值：</label>
                <%if (hasPriviledge){ %>
                <em><%= Html.DisplayFor(model => model.catchpit_water_ph)%></em>
                <%} else { %>
                ☆
                <%} %>
            </td>
        </tr>
        <tr>
            <td>
                <label>抽水量：</label>
                <em><%= Html.DisplayFor(model => model.pumpage)%></em>
                <small><%if (Model.pumpage.HasValue) { %> m<sup>3</sup>/hr<%} %></small>
            </td>
            <td>
                <label>持续时间：</label>
                <em><%= Html.DisplayFor(model => model.pump_time)%></em>
            </td>
        </tr>
    </table>
    

    <table cellpadding="4" cellspacing="0" class="com_from_table3" style="width:756px;">
        <tr>
            <th colspan="5">膜底导渗系统</th>
        </tr>
        <tr>
            <td></td>
            <td style="text-align:center;">流量</td>
            <td style="text-align:center;">PH值</td>
            <td style="text-align:center;">水流状况</td>
            <td style="text-align:center;">描述</td>
        </tr>
        <tr>
            <td class="lab" style="width:110px; text-align:center;">导渗管A</td>
            <td style="width:130px; text-align:center;">
                <%if (Model.tube_a_flow == 1){ %>满管<%} %>
                <%if (Model.tube_a_flow == 0.875){ %>7/8管<%} %>
                <%if (Model.tube_a_flow == 0.75){ %>6/8管<%} %>
                <%if (Model.tube_a_flow == 0.625){ %>5/8管<%} %>
                <%if (Model.tube_a_flow == 0.5){ %>4/8管<%} %>
                <%if (Model.tube_a_flow == 0.375){ %>3/8管<%} %>
                <%if (Model.tube_a_flow == 0.25){ %>2/8管<%} %>
                <%if (Model.tube_a_flow == 0.125){ %>1/8管<%} %>
                <%if (Model.tube_a_flow == 0){ %>断流<%} %>
            </td>
            <td style="width:80px; text-align:center;">
                <%if (hasPriviledge){ %>
                <%= Html.DisplayFor(model => model.tube_a_ph, new { style = "width:50px" })%>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td style="width:130px; text-align:center;">
                <%if (Model.tube_a_quality == 1){ %>清澈<%} %>
                <%if (Model.tube_a_quality == 2){ %>含土颗粒<%} %>
                <%if (Model.tube_a_quality == 3){ %>浑浊<%} %>
            </td>
            <td style="text-align:center;">库区渗水</td>
        </tr>
        <tr>
            <td class="lab" style="text-align:center;">导渗管B</td>
            <td style="text-align:center;">
                <%if (Model.tube_b_flow == 1){ %>满管<%} %>
                <%if (Model.tube_b_flow == 0.875){ %>7/8管<%} %>
                <%if (Model.tube_b_flow == 0.75){ %>6/8管<%} %>
                <%if (Model.tube_b_flow == 0.625){ %>5/8管<%} %>
                <%if (Model.tube_b_flow == 0.5){ %>4/8管<%} %>
                <%if (Model.tube_b_flow == 0.375){ %>3/8管<%} %>
                <%if (Model.tube_b_flow == 0.25){ %>2/8管<%} %>
                <%if (Model.tube_b_flow == 0.125){ %>1/8管<%} %>
                <%if (Model.tube_b_flow == 0){ %>断流<%} %>
            </td>
            <td style="text-align:center;">
                <%if (hasPriviledge){ %>
                <%= Html.DisplayFor(model => model.tube_b_ph, new { style = "width:50px" })%>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td style="text-align:center;">
                <%if (Model.tube_b_quality == 1){ %>清澈<%} %>
                <%if (Model.tube_b_quality == 2){ %>含土颗粒<%} %>
                <%if (Model.tube_b_quality == 3){ %>浑浊<%} %>
            </td>
            <td style="text-align:center;">库尾渗水</td>
        </tr>
        <tr>
            <td class="lab" style="text-align:center;">导渗管C</td>
            <td style="text-align:center;">
                <%if (Model.tube_c_flow == 1){ %>满管<%} %>
                <%if (Model.tube_c_flow == 0.875){ %>7/8管<%} %>
                <%if (Model.tube_c_flow == 0.75){ %>6/8管<%} %>
                <%if (Model.tube_c_flow == 0.625){ %>5/8管<%} %>
                <%if (Model.tube_c_flow == 0.5){ %>4/8管<%} %>
                <%if (Model.tube_c_flow == 0.375){ %>3/8管<%} %>
                <%if (Model.tube_c_flow == 0.25){ %>2/8管<%} %>
                <%if (Model.tube_c_flow == 0.125){ %>1/8管<%} %>
                <%if (Model.tube_c_flow == 0){ %>断流<%} %>
            </td>
            <td style="text-align:center;">
                <%if (hasPriviledge){ %>
                <%= Html.DisplayFor(model => model.tube_c_ph, new { style = "width:50px" })%>
                <%} else { %>
                ☆
                <%} %>
            </td>
            <td style="text-align:center;">
                <%if (Model.tube_c_quality == 1){ %>清澈<%} %>
                <%if (Model.tube_c_quality == 2){ %>含土颗粒<%} %>
                <%if (Model.tube_c_quality == 3){ %>浑浊<%} %>
            </td>
            <td style="text-align:center;">库区渗水</td>
        </tr>

    </table>




    <fieldset class="tf_style">
        <legend>当日情况补充：</legend>
        <p style="padding-left:5px"><%=string.IsNullOrEmpty(Model.descriptoin) ? "无" : Model.descriptoin%></p>
    </fieldset>
    <script type="text/javascript" language="javascript">
        $('#date').datepicker({ changeMonth: true, changeYear: true });

        function showStacks() {
            var factoryId = document.getElementById("factoryId").value;
            if (factoryId == "" || factoryId == 0) return;
            $.ajax({ 
                    type: "POST",
                    url: "<%=Url.Content("~/Modification/ListStacks") %>",
                    data: "factoryId=" + factoryId,
                    success: function (data) { $("#stackList").html(data);}
            });
        }
    </script>
</asp:Content>
